package Day29.lx.principle.ocp;

public class offNovelBook extends NovelBook{
    public offNovelBook(String name, int price, String author) {
        super(name, price, author);
    }

    @Override
    public int getPrice() {
        int sellPrice = super.getPrice();
        int offPrice = 0;
        if(sellPrice > 7000){
            offPrice = sellPrice*90/100;
        }else{
            offPrice = sellPrice*80/100;
        }
        return offPrice;
    }
}
